% read in adv burst file and convert to .mat file for each burst
%be sure to set burst length.  This script assumes that there is a complete
%burst taken at each burst interval... be sure to adjust fb to reflect
%correct burst length

name='DEC3S202_';       % the name each burst will be saved at with a new burst number
fba=dlmread('DEC3S202.vhd');  %open burst averaged file
fid=fopen('DEC3S202.dat');    %deployment time series
l=length(fba);

%for i=1:3412
%for i= 3414:l
for i=1:l
    i
 %fb=fscanf(fid,'%f',[11 8192])';  %8192 = burst length = 5.46 min burst @ 25Hz
                                  % no compass or temp sensors
%fb=fscanf(fid,'%f',[16 8192])';  %8192 = burst length = 5.46 min burst @ 25Hz
%fb=fscanf(fid,'%f',[16 1200])';  %1200 = burst length = 2 min burst @ 10Hz

%fb=fscanf(fid,'%f',[18 1200])';  %1200 = burst length = 2 min burst @ 10Hz

fb=fscanf(fid,'%f',[18 2400])';  %2400 = burst length = 2.5 min burst @ 16Hz

fnum=sprintf('%04d',i+5);
fn=[name fnum];
save(fn,'fb')
end

fclose(fid);
